package com.example.servlet.config;

import com.example.servlet.servlet.MyServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description : servlet 配置类
 * @Author : Bruce Lee
 * @CreateTime : 2024/3/26
 */


@Configuration
public class ServletConfig {

    @Bean
    public ServletRegistrationBean myServletRegistrationBean() {
        ServletRegistrationBean servletRegistrationBean=new ServletRegistrationBean(
                new MyServlet(),"/ServletDemo"
        );
        return servletRegistrationBean;
    }

}
